// DHT11Sensor.h
#pragma once
#include <DHT.h>

class DHT11Sensor {
public:
    DHT11Sensor(uint8_t pin);  // 修改构造函数
    void begin();
    void readData();
    float getTemperature() const { return temp; }
    int getHumidity() const { return humid; }
    
private:
    DHT dht;
    float temp = 0;
    int humid = 0;
    uint8_t _pin;  // 添加引脚成员
};
